/*
 * @Author: your name
 * @Date: 2021-09-07 09:59:29
 * @LastEditTime: 2021-12-14 13:43:54
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \itemcenter-front\src\api\handlerPurchase.js
 */
import request from '../utils/request'

const prefix = process.env.VUE_APP_BASE_API10
// -----查询渠道
export function API_getBusinessDefineList(params) {
  return request({
    url: `${prefix}/store/getBusinessDefineList`,
    method: 'post',
    data: params
  })
}
// -----查询门店
export function API_selectAllStore(params) {
  return request({
    url: `${prefix}/store/selectAllStore`,
    method: 'post',
    data: params
  })
}

// -----全球购查询商品
export function API_globalQuery(params) {
  return request({
    url: `mlapi/sams/global/item/info/page`,
    method: 'post',
    data: params
  })
}

// -----限购规则导出
export function API_restrictExport(params) {
  return request({
    url: `/common-restrict-server/hyperRestrict/exportRestrictRule`,
    method: 'post',
    data: params,
    responseType: 'blob'
  })
}

// -----分页查询商品限购规则
export function API_restrictPage(params) {
  return request({
    url: `/item-oe/findPageHyperRestrict`,
    method: 'post',
    data: params
  })
}

// -----批次添加商品限购规则
export function API_restrictBatchAdd(params) {
  return request({
    url: `/item-oe/batchAddHyperRestrict`,
    method: 'post',
    data: params
  })
}

// -----编辑商品限购规则
export function API_restrictEdit(params) {
  return request({
    url: `/item-oe/editHyperRestrictRule`,
    method: 'post',
    data: params
  })
}

// -----根据UPC查询商品
export function API_restrictUpc(params) {
  return request({
    url: `/item-oe/findByUpc`,
    method: 'post',
    data: params
  })
}

// ----- 全量查询商品限购规则
export function API_restrictList(params) {
  return request({
    url: `/item-oe/findHyperRestrictRuleList`,
    method: 'post',
    data: params
  })
}
// 获取各级城市和店铺id
export function API_findAllStore(params) {
  return request({
    url: `/item-oe/findAllHyperStore`,
    method: 'post',
    data: params
  })
}
// 根据店铺id查询店铺
export function API_findStoreNameById(params) {
  return request({
    url: `/item-oe/findHyperStoreNameById`,
    method: 'post',
    data: params
  })
}
